import { check } from 'meteor/check';

Meteor.methods({
  editProfile(key, value) {
    check(key, String);
    check(value, String);
    Meteor.users.update({_id: Meteor.userId()}, {
      $set: {[key]: value}
    });
  },
  getUser(username) {
    check(username, String);
    return Meteor.users.findOne({ 
      username: username
    }, {
      fields: {
        services: 0
      }
    });
  }
});